package com.itheima.controller;

import com.itheima.pojo.Dept;
import com.itheima.pojo.EmpIn;
import com.itheima.pojo.EmpOut;
import com.itheima.pojo.Result;
import com.itheima.service.EmpInService;
import com.itheima.service.EmpOutService;
import com.itheima.service.impl.DeptServiceImpl;
import com.itheima.service.DeptService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.logging.Logger;
@Slf4j
@RestController
public class EmpOutController {

    @Autowired
    private EmpOutService empOutService;
    //private static Logger log= LoggerFactory.getILogger(DeptController.class);
    // @RequestMapping(value = "/depts",method = )
    @GetMapping("/empout")
    public Result list(){
        log.info("查询全部部门数据");
        List<EmpOut> empoutList= empOutService.list();
        return Result.success(empoutList);
    }
//    @DeleteMapping("/depts/{id}")
//    public Result delete(@PathVariable Integer id){
//        log.info("根据id删除部门:{}",id);
//        deptService.delete(id);
//        return Result.success();
//    }
//    @PostMapping("/depts")
//    public Result add(@RequestBody Dept dept){
//        log.info("新增部门:{}",dept);
//        deptService.add(dept);
//        return Result.success();
//    }
//    @GetMapping("/depts/{id}")
//    public Result find1(@PathVariable Integer id){
//        log.info("根据id查询部门:{}",id);
//
//        Dept dept=deptService.find2(id);
//        return Result.success(dept);
//    }
//    @PutMapping("/depts")
//    public Result update1(@RequestBody Dept dept){
//        log.info("修改部门为:{}",dept);
//        deptService.update2(dept);
//        return Result.success();
//    }

}
